# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from fastapi import APIRouter
from hypertext import R, response_json
from apps.admin.schemas.apply.draws import setting_schema as schema
from apps.admin.service.apply.draws.setting_service import DrawsSettingService


router = APIRouter(prefix="/setting", tags=["MJ配置接口"])


@router.get("/mj_detail", summary="Mj配置详情", response_model=R[schema.MjSetting])
@response_json
async def mj_detail():
    return await DrawsSettingService.mj_detail()


@router.post("/mj_save", summary="Mj配置保存", response_model=R)
@response_json
async def mj_save(params: schema.MjSetting):
    return await DrawsSettingService.mj_save(params)


@router.get("/sd_detail", summary="SD配置详情", response_model=R[schema.SdSetting])
@response_json
async def sd_detail():
    return await DrawsSettingService.sd_detail()


@router.post("/sd_save", summary="SD配置保存", response_model=R)
@response_json
async def sd_save(params: schema.SdSetting):
    return await DrawsSettingService.sd_save(params)


@router.get("/dalle_detail", summary="DALLE配置详情", response_model=R[schema.DalleSetting])
@response_json
async def dalle_detail():
    return await DrawsSettingService.dalle_detail()


@router.post("/dalle_save", summary="DALLE配置保存", response_model=R)
@response_json
async def dalle_save(params: schema.DalleSetting):
    return await DrawsSettingService.dalle_save(params)


@router.get("/doubao_detail", summary="豆包配置详情", response_model=R[schema.DoubaoSetting])
@response_json
async def doubao_detail():
    return await DrawsSettingService.doubao_detail()


@router.post("/doubao_save", summary="豆包配置保存", response_model=R)
@response_json
async def doubao_save(params: schema.DoubaoSetting):
    return await DrawsSettingService.doubao_save(params)
